import axios from '../utils/axiosUtils';
import { IAddUser } from '../types/user';

//根据用户信息获取菜单
export const menuApi: any = (username: string) =>
  axios.get(`/menu/${username}`);

//获取用户信息
export const userAllApi: any = (data: number) => axios.get(`/user?${data}`);
//新增用户
export const addUserApi: any = (data: IAddUser) => axios.post('/user', data);
// console.log(addUserApi);

//删除用户
export const deleteUserApi: any = (userId: string) =>
  axios.delete(`user/${userId}`);

//修改用户
export const searchApi: any = (data: IAddUser) => axios.put('/user', data);
console.log(searchApi);

//获取角色信息
export const roleAllApi: any = (data: number) => axios.get(`/role?${data}`);

//获取部门信息
export const deptAllApi: any = () => axios.get('/dept');

//获取菜单数据
export const menuAllApi: any = (data: number) => axios.get(`/menu?${data}`);

//获取商家信息
export const allShopApi: any = (data: number) =>
  axios.get('/gen/shop/findAll', data);
//商铺审核
export const allApplyApi: any = (data: number) => axios.get('/gen/apply', data);
